package com.tusuo.stds.ui.draft;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebView;

import com.tusuo.stds.R;

import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.WindowFeature;
import org.androidannotations.annotations.res.ColorRes;

import javax.inject.Inject;

import me.panavtec.drawableview.DrawableView;
import me.panavtec.drawableview.DrawableViewConfig;
import myandroid.library.util.CookieHelper;

@EActivity(R.layout.activity_draft)
@WindowFeature({Window.FEATURE_NO_TITLE})
public class DraftActivity extends Activity {

    @ViewById(R.id.draft_paintview)
    DrawableView drawableView;

    @ColorRes(R.color.white)
    int colorWhite;

    @AfterViews
    void init() {
        DrawableViewConfig config = new DrawableViewConfig();
        config.setStrokeColor(colorWhite);
        config.setShowCanvasBounds(true); // If the view is bigger than canvas, with this the user will see the bounds (Recommended)
        config.setStrokeWidth(5.0f);
        config.setMinZoom(1.0f);
        config.setMaxZoom(3.0f);
        config.setCanvasHeight(5000);
        config.setCanvasWidth(5000);
        drawableView.setConfig(config);
    }

    @Click(R.id.draft_btn_undo)
    void undo() {
        drawableView.undo();
    }

    @Click(R.id.draft_btn_close)
    void close() {
        finish();
    }

    @Click(R.id.draft_btn_clear)
    void clear() {
        drawableView.clear();
    }
}
